﻿/*
Post-Deployment Script Template							
--------------------------------------------------------------------------------------
 This file contains SQL statements that will be appended to the build script.		
 Use SQLCMD syntax to include a file in the post-deployment script.			
 Example:      :r .\myfile.sql								
 Use SQLCMD syntax to reference a variable in the post-deployment script.		
 Example:      :setvar TableName MyTable							
               SELECT * FROM [$(TableName)]					
--------------------------------------------------------------------------------------
*/
IF NOT EXISTS (SELECT * FROM [aspnet_SchemaVersions] WHERE [Feature] = 'common')
BEGIN
	INSERT INTO [aspnet_SchemaVersions]
			   ([Feature]
			   ,[CompatibleSchemaVersion]
			   ,[IsCurrentVersion])
		 VALUES
			   ('common'
			   ,'1'
			   ,1)
END
IF NOT EXISTS (SELECT * FROM [aspnet_SchemaVersions] WHERE [Feature] = 'health')
BEGIN
	INSERT INTO [aspnet_SchemaVersions]
			   ([Feature]
			   ,[CompatibleSchemaVersion]
			   ,[IsCurrentVersion])
		 VALUES
			   ('health'
			   ,'1'
			   ,1)
END
IF NOT EXISTS (SELECT * FROM [aspnet_SchemaVersions] WHERE [Feature] = 'membership')
BEGIN
	INSERT INTO [aspnet_SchemaVersions]
			   ([Feature]
			   ,[CompatibleSchemaVersion]
			   ,[IsCurrentVersion])
		 VALUES
			   ('membership'
			   ,'1'
			   ,1)
END
IF NOT EXISTS (SELECT * FROM [aspnet_SchemaVersions] WHERE [Feature] = 'personalization')
BEGIN
	INSERT INTO [aspnet_SchemaVersions]
			   ([Feature]
			   ,[CompatibleSchemaVersion]
			   ,[IsCurrentVersion])
		 VALUES
			   ('personalization'
			   ,'1'
			   ,1)
END
IF NOT EXISTS (SELECT * FROM [aspnet_SchemaVersions] WHERE [Feature] = 'profile')
BEGIN
	INSERT INTO [aspnet_SchemaVersions]
			   ([Feature]
			   ,[CompatibleSchemaVersion]
			   ,[IsCurrentVersion])
		 VALUES
			   ('profile'
			   ,'1'
			   ,1)
END
GO
